import { createRouter, createWebHistory } from "vue-router";
import Home from "../views/HomeView.vue";
import ExaminationView from "../views/ExaminationView.vue";
import DailyNewspaperView from "../views/DailyNewspaperView.vue";
import MeView from "../views/MeView.vue";
import ForumView from "../views/ForumView.vue";
import Error404View from "../views/Error404View.vue";

const routes = [
  {
    path: "/",
    name: "home",
    component: Home,
  },
  {
    path: "/examination",
    name: "examination",
    component: ExaminationView,
  },
  {
    path: "/dailynewspaper",
    name: "dailynewspaper",
    component: DailyNewspaperView,
  },
  {
    path: "/forum",
    name: "forum",
    component: ForumView,
  },
  {
    path: "/me",
    name: "me",
    component: MeView,
  },
  {
    path: "/login",
    name: "login",
    component: () => import("../views/LoginView.vue"),
  },
  {
    path: "/:pathMatch(.*)*",
    name: "Error404",
    component: Error404View,
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
